

$(document).ready(function() {
    $("input[name='stuName']").val("小红");
    $("input[name='stuNum']").val("20151000");
    $("input[name='stuSex']").val("女");
    $("input[name='academy']").val("华信软件学院");
    $("input[name='termYear']").val("2015-2016");
    $("input[name='termNum']").val("第一学期");
});

/*提交申请*/
$(document).on('click', '#apply-btn', function() {
    // var $stuName=$("input[name='stuName']").val();

    //var $sutNum=$("input[name='sutNum']").val();

    // var $stuSex=$("input[name='stuSex']").val();

    // var $termYear=$("input[name='termYear']").val();

    // var $termNum=$("input[name='termNum']").val();

    var projectName=$("input[name='projectName']").val();
    var projectPlatform=$("input[name='projectPlatform']").val();
    var projectContact=$("input[name='projectContact']").val();
    var projectPhonenum=$("input[name='projectPhonenum']").val();
    var projectContent=$("textarea[name='projectContent']").val();
    var startDate=$("input[name='startDate']").val();
    var endDate=$("input[name='endDate']").val();
    var project_state=2;


    $.ajax({
        url: "http://localhost:8080/project/applyProject",
        type: "GET",
        data:"termId="+1+"&stuInfoId="+1+"&projectName="+projectName+"&projectContent="+projectContent+"&projectPhonenum="+projectPhonenum
        +"&projectStartDate="+startDate+"&projectEndDate="+endDate+"&projectContactPeople="+projectContact+
        "&projectPlatform="+projectPlatform+"&projectState="+project_state,
        dataType: "json",
        success:function (data) {
            var msg="申请成功！请耐心等待！";
            $.each(data.data,function (key,value) {
                msg=value;
            });
            layer.msg(msg);

        },
        error:function () {
            layer.msg("网络在开小差~稍后重试");
        }
    });
});


$(document).on('click','#re-btn',function () {
    $("input[name='projectName']").val("");
    $("input[name='projectPlatform']").val("");
    $("input[name='projectContact']").val("");
    $("input[name='projectPhonenum']").val("");
    $("textarea[name='projectContent']").val("");
    $("input[name='startDate']").val("");
    $("input[name='endDate']").val("");

});
